3.2364 \(\int \frac{(A+B x) (d+e x)^2}{a+b x+c x^2} \, dx\)

Optimal. Leaf size=205 \[ \frac{\log \left (a+b x+c x^2\right ) \left (B \left (-c e (a e+2 b d)+b^2 e^2+c^2 d^2\right )+A c e (2 c d-b e)\right )}{2 c^3}+\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (b c \left (-3 a B e^2+2 A c d e+B c d^2\right )-2 c^2 \left (-a A e^2-2 a B d e+A c d^2\right )-b^2 c e (A e+2 B d)+b^3 B e^2\right )}{c^3 \sqrt{b^2-4 a c}}+\frac{e x (A c e-b B e+2 B c d)}{c^2}+\frac{B e^2 x^2}{2 c} \]

[Out]

(e*(2*B*c*d - b*B*e + A*c*e)*x)/c^2 + (B*e^2*x^2)/(2*c) + ((b^3*B*e^2 - b^2*c*e*
(2*B*d + A*e) - 2*c^2*(A*c*d^2 - 2*a*B*d*e - a*A*e^2) + b*c*(B*c*d^2 + 2*A*c*d*e
 - 3*a*B*e^2))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^3*Sqrt[b^2 - 4*a*c]) +
 ((A*c*e*(2*c*d - b*e) + B*(c^2*d^2 + b^2*e^2 - c*e*(2*b*d + a*e)))*Log[a + b*x
+ c*x^2])/(2*c^3)

_______________________________________________________________________________________

Rubi [A]  time = 0.764161, antiderivative size = 205, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2 \[ \frac{\log \left (a+b x+c x^2\right ) \left (B \left (-c e (a e+2 b d)+b^2 e^2+c^2 d^2\right )+A c e (2 c d-b e)\right )}{2 c^3}+\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (b c \left (-3 a B e^2+2 A c d e+B c d^2\right )-2 c^2 \left (-a A e^2-2 a B d e+A c d^2\right )-b^2 c e (A e+2 B d)+b^3 B e^2\right )}{c^3 \sqrt{b^2-4 a c}}+\frac{e x (A c e-b B e+2 B c d)}{c^2}+\frac{B e^2 x^2}{2 c} \]

Antiderivative was successfully verified.

[In]  Int[((A + B*x)*(d + e*x)^2)/(a + b*x + c*x^2),x]

[Out]

(e*(2*B*c*d - b*B*e + A*c*e)*x)/c^2 + (B*e^2*x^2)/(2*c) + ((b^3*B*e^2 - b^2*c*e*
(2*B*d + A*e) - 2*c^2*(A*c*d^2 - 2*a*B*d*e - a*A*e^2) + b*c*(B*c*d^2 + 2*A*c*d*e
 - 3*a*B*e^2))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^3*Sqrt[b^2 - 4*a*c]) +
 ((A*c*e*(2*c*d - b*e) + B*(c^2*d^2 + b^2*e^2 - c*e*(2*b*d + a*e)))*Log[a + b*x
+ c*x^2])/(2*c^3)

_______________________________________________________________________________________

Rubi in Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((B*x+A)*(e*x+d)**2/(c*x**2+b*x+a),x)

[Out]

Timed out

_______________________________________________________________________________________

Mathematica [A]  time = 0.34552, size = 203, normalized size = 0.99 \[ \frac{\log (a+x (b+c x)) \left (B \left (-c e (a e+2 b d)+b^2 e^2+c^2 d^2\right )+A c e (2 c d-b e)\right )-\frac{2 \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right ) \left (b c \left (-3 a B e^2+2 A c d e+B c d^2\right )+2 c^2 \left (a A e^2+2 a B d e-A c d^2\right )-b^2 c e (A e+2 B d)+b^3 B e^2\right )}{\sqrt{4 a c-b^2}}+2 c e x (A c e-b B e+2 B c d)+B c^2 e^2 x^2}{2 c^3} \]

Antiderivative was successfully verified.

[In]  Integrate[((A + B*x)*(d + e*x)^2)/(a + b*x + c*x^2),x]

[Out]

(2*c*e*(2*B*c*d - b*B*e + A*c*e)*x + B*c^2*e^2*x^2 - (2*(b^3*B*e^2 - b^2*c*e*(2*
B*d + A*e) + 2*c^2*(-(A*c*d^2) + 2*a*B*d*e + a*A*e^2) + b*c*(B*c*d^2 + 2*A*c*d*e
 - 3*a*B*e^2))*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/Sqrt[-b^2 + 4*a*c] + (A*c
*e*(2*c*d - b*e) + B*(c^2*d^2 + b^2*e^2 - c*e*(2*b*d + a*e)))*Log[a + x*(b + c*x
)])/(2*c^3)

_______________________________________________________________________________________

Maple [B]  time = 0.007, size = 543, normalized size = 2.7 \[{\frac{B{e}^{2}{x}^{2}}{2\,c}}+{\frac{{e}^{2}Ax}{c}}-{\frac{B{e}^{2}bx}{{c}^{2}}}+2\,{\frac{Bedx}{c}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) Ab{e}^{2}}{2\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ) Ade}{c}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) Ba{e}^{2}}{2\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ) B{b}^{2}{e}^{2}}{2\,{c}^{3}}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) Bbde}{{c}^{2}}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ) B{d}^{2}}{2\,c}}-2\,{\frac{Aa{e}^{2}}{c\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+2\,{\frac{A{d}^{2}}{\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+3\,{\frac{B{e}^{2}ab}{{c}^{2}\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-4\,{\frac{aBde}{c\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+{\frac{A{b}^{2}{e}^{2}}{{c}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-2\,{\frac{Abde}{c\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-{\frac{{b}^{3}B{e}^{2}}{{c}^{3}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+2\,{\frac{{b}^{2}Bde}{{c}^{2}\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-{\frac{bB{d}^{2}}{c}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((B*x+A)*(e*x+d)^2/(c*x^2+b*x+a),x)

[Out]

1/2*B*e^2*x^2/c+e^2/c*A*x-e^2/c^2*b*B*x+2*e/c*B*d*x-1/2/c^2*ln(c*x^2+b*x+a)*A*b*
e^2+1/c*ln(c*x^2+b*x+a)*A*d*e-1/2/c^2*ln(c*x^2+b*x+a)*B*a*e^2+1/2/c^3*ln(c*x^2+b
*x+a)*B*b^2*e^2-1/c^2*ln(c*x^2+b*x+a)*B*b*d*e+1/2/c*ln(c*x^2+b*x+a)*B*d^2-2/c/(4
*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*A*a*e^2+2/(4*a*c-b^2)^(1/2)*
arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*A*d^2+3/c^2/(4*a*c-b^2)^(1/2)*arctan((2*c*x+
b)/(4*a*c-b^2)^(1/2))*B*e^2*a*b-4/c/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^
2)^(1/2))*B*a*d*e+1/c^2/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*A*
b^2*e^2-2/c/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*b*A*d*e-1/c^3/
(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*b^3*B*e^2+2/c^2/(4*a*c-b^2
)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*b^2*B*d*e-1/c/(4*a*c-b^2)^(1/2)*arct
an((2*c*x+b)/(4*a*c-b^2)^(1/2))*b*B*d^2

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)*(e*x + d)^2/(c*x^2 + b*x + a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

_______________________________________________________________________________________

Fricas [A]  time = 0.302013, size = 1, normalized size = 0. \[ \left [\frac{{\left ({\left (B b c^{2} - 2 \, A c^{3}\right )} d^{2} - 2 \,{\left (B b^{2} c -{\left (2 \, B a + A b\right )} c^{2}\right )} d e +{\left (B b^{3} + 2 \, A a c^{2} -{\left (3 \, B a b + A b^{2}\right )} c\right )} e^{2}\right )} \log \left (\frac{b^{3} - 4 \, a b c + 2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} x +{\left (2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c\right )} \sqrt{b^{2} - 4 \, a c}}{c x^{2} + b x + a}\right ) +{\left (B c^{2} e^{2} x^{2} + 2 \,{\left (2 \, B c^{2} d e -{\left (B b c - A c^{2}\right )} e^{2}\right )} x +{\left (B c^{2} d^{2} - 2 \,{\left (B b c - A c^{2}\right )} d e +{\left (B b^{2} -{\left (B a + A b\right )} c\right )} e^{2}\right )} \log \left (c x^{2} + b x + a\right )\right )} \sqrt{b^{2} - 4 \, a c}}{2 \, \sqrt{b^{2} - 4 \, a c} c^{3}}, -\frac{2 \,{\left ({\left (B b c^{2} - 2 \, A c^{3}\right )} d^{2} - 2 \,{\left (B b^{2} c -{\left (2 \, B a + A b\right )} c^{2}\right )} d e +{\left (B b^{3} + 2 \, A a c^{2} -{\left (3 \, B a b + A b^{2}\right )} c\right )} e^{2}\right )} \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) -{\left (B c^{2} e^{2} x^{2} + 2 \,{\left (2 \, B c^{2} d e -{\left (B b c - A c^{2}\right )} e^{2}\right )} x +{\left (B c^{2} d^{2} - 2 \,{\left (B b c - A c^{2}\right )} d e +{\left (B b^{2} -{\left (B a + A b\right )} c\right )} e^{2}\right )} \log \left (c x^{2} + b x + a\right )\right )} \sqrt{-b^{2} + 4 \, a c}}{2 \, \sqrt{-b^{2} + 4 \, a c} c^{3}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)*(e*x + d)^2/(c*x^2 + b*x + a),x, algorithm="fricas")

[Out]

[1/2*(((B*b*c^2 - 2*A*c^3)*d^2 - 2*(B*b^2*c - (2*B*a + A*b)*c^2)*d*e + (B*b^3 +
2*A*a*c^2 - (3*B*a*b + A*b^2)*c)*e^2)*log((b^3 - 4*a*b*c + 2*(b^2*c - 4*a*c^2)*x
 + (2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c)*sqrt(b^2 - 4*a*c))/(c*x^2 + b*x + a)) + (
B*c^2*e^2*x^2 + 2*(2*B*c^2*d*e - (B*b*c - A*c^2)*e^2)*x + (B*c^2*d^2 - 2*(B*b*c
- A*c^2)*d*e + (B*b^2 - (B*a + A*b)*c)*e^2)*log(c*x^2 + b*x + a))*sqrt(b^2 - 4*a
*c))/(sqrt(b^2 - 4*a*c)*c^3), -1/2*(2*((B*b*c^2 - 2*A*c^3)*d^2 - 2*(B*b^2*c - (2
*B*a + A*b)*c^2)*d*e + (B*b^3 + 2*A*a*c^2 - (3*B*a*b + A*b^2)*c)*e^2)*arctan(-sq
rt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) - (B*c^2*e^2*x^2 + 2*(2*B*c^2*d*e -
(B*b*c - A*c^2)*e^2)*x + (B*c^2*d^2 - 2*(B*b*c - A*c^2)*d*e + (B*b^2 - (B*a + A*
b)*c)*e^2)*log(c*x^2 + b*x + a))*sqrt(-b^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*c^3)]

_______________________________________________________________________________________

Sympy [A]  time = 32.0635, size = 1532, normalized size = 7.47 \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x+A)*(e*x+d)**2/(c*x**2+b*x+a),x)

[Out]

B*e**2*x**2/(2*c) + (-sqrt(-4*a*c + b**2)*(-2*A*a*c**2*e**2 + A*b**2*c*e**2 - 2*
A*b*c**2*d*e + 2*A*c**3*d**2 + 3*B*a*b*c*e**2 - 4*B*a*c**2*d*e - B*b**3*e**2 + 2
*B*b**2*c*d*e - B*b*c**2*d**2)/(2*c**3*(4*a*c - b**2)) - (A*b*c*e**2 - 2*A*c**2*
d*e + B*a*c*e**2 - B*b**2*e**2 + 2*B*b*c*d*e - B*c**2*d**2)/(2*c**3))*log(x + (A
*a*b*c*e**2 - 4*A*a*c**2*d*e + A*b*c**2*d**2 + 2*B*a**2*c*e**2 - B*a*b**2*e**2 +
 2*B*a*b*c*d*e - 2*B*a*c**2*d**2 + 4*a*c**3*(-sqrt(-4*a*c + b**2)*(-2*A*a*c**2*e
**2 + A*b**2*c*e**2 - 2*A*b*c**2*d*e + 2*A*c**3*d**2 + 3*B*a*b*c*e**2 - 4*B*a*c*
*2*d*e - B*b**3*e**2 + 2*B*b**2*c*d*e - B*b*c**2*d**2)/(2*c**3*(4*a*c - b**2)) -
 (A*b*c*e**2 - 2*A*c**2*d*e + B*a*c*e**2 - B*b**2*e**2 + 2*B*b*c*d*e - B*c**2*d*
*2)/(2*c**3)) - b**2*c**2*(-sqrt(-4*a*c + b**2)*(-2*A*a*c**2*e**2 + A*b**2*c*e**
2 - 2*A*b*c**2*d*e + 2*A*c**3*d**2 + 3*B*a*b*c*e**2 - 4*B*a*c**2*d*e - B*b**3*e*
*2 + 2*B*b**2*c*d*e - B*b*c**2*d**2)/(2*c**3*(4*a*c - b**2)) - (A*b*c*e**2 - 2*A
*c**2*d*e + B*a*c*e**2 - B*b**2*e**2 + 2*B*b*c*d*e - B*c**2*d**2)/(2*c**3)))/(-2
*A*a*c**2*e**2 + A*b**2*c*e**2 - 2*A*b*c**2*d*e + 2*A*c**3*d**2 + 3*B*a*b*c*e**2
 - 4*B*a*c**2*d*e - B*b**3*e**2 + 2*B*b**2*c*d*e - B*b*c**2*d**2)) + (sqrt(-4*a*
c + b**2)*(-2*A*a*c**2*e**2 + A*b**2*c*e**2 - 2*A*b*c**2*d*e + 2*A*c**3*d**2 + 3
*B*a*b*c*e**2 - 4*B*a*c**2*d*e - B*b**3*e**2 + 2*B*b**2*c*d*e - B*b*c**2*d**2)/(
2*c**3*(4*a*c - b**2)) - (A*b*c*e**2 - 2*A*c**2*d*e + B*a*c*e**2 - B*b**2*e**2 +
 2*B*b*c*d*e - B*c**2*d**2)/(2*c**3))*log(x + (A*a*b*c*e**2 - 4*A*a*c**2*d*e + A
*b*c**2*d**2 + 2*B*a**2*c*e**2 - B*a*b**2*e**2 + 2*B*a*b*c*d*e - 2*B*a*c**2*d**2
 + 4*a*c**3*(sqrt(-4*a*c + b**2)*(-2*A*a*c**2*e**2 + A*b**2*c*e**2 - 2*A*b*c**2*
d*e + 2*A*c**3*d**2 + 3*B*a*b*c*e**2 - 4*B*a*c**2*d*e - B*b**3*e**2 + 2*B*b**2*c
*d*e - B*b*c**2*d**2)/(2*c**3*(4*a*c - b**2)) - (A*b*c*e**2 - 2*A*c**2*d*e + B*a
*c*e**2 - B*b**2*e**2 + 2*B*b*c*d*e - B*c**2*d**2)/(2*c**3)) - b**2*c**2*(sqrt(-
4*a*c + b**2)*(-2*A*a*c**2*e**2 + A*b**2*c*e**2 - 2*A*b*c**2*d*e + 2*A*c**3*d**2
 + 3*B*a*b*c*e**2 - 4*B*a*c**2*d*e - B*b**3*e**2 + 2*B*b**2*c*d*e - B*b*c**2*d**
2)/(2*c**3*(4*a*c - b**2)) - (A*b*c*e**2 - 2*A*c**2*d*e + B*a*c*e**2 - B*b**2*e*
*2 + 2*B*b*c*d*e - B*c**2*d**2)/(2*c**3)))/(-2*A*a*c**2*e**2 + A*b**2*c*e**2 - 2
*A*b*c**2*d*e + 2*A*c**3*d**2 + 3*B*a*b*c*e**2 - 4*B*a*c**2*d*e - B*b**3*e**2 +
2*B*b**2*c*d*e - B*b*c**2*d**2)) - x*(-A*c*e**2 + B*b*e**2 - 2*B*c*d*e)/c**2

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.334128, size = 296, normalized size = 1.44 \[ \frac{B c x^{2} e^{2} + 4 \, B c d x e - 2 \, B b x e^{2} + 2 \, A c x e^{2}}{2 \, c^{2}} + \frac{{\left (B c^{2} d^{2} - 2 \, B b c d e + 2 \, A c^{2} d e + B b^{2} e^{2} - B a c e^{2} - A b c e^{2}\right )}{\rm ln}\left (c x^{2} + b x + a\right )}{2 \, c^{3}} - \frac{{\left (B b c^{2} d^{2} - 2 \, A c^{3} d^{2} - 2 \, B b^{2} c d e + 4 \, B a c^{2} d e + 2 \, A b c^{2} d e + B b^{3} e^{2} - 3 \, B a b c e^{2} - A b^{2} c e^{2} + 2 \, A a c^{2} e^{2}\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} c^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)*(e*x + d)^2/(c*x^2 + b*x + a),x, algorithm="giac")

[Out]

1/2*(B*c*x^2*e^2 + 4*B*c*d*x*e - 2*B*b*x*e^2 + 2*A*c*x*e^2)/c^2 + 1/2*(B*c^2*d^2
 - 2*B*b*c*d*e + 2*A*c^2*d*e + B*b^2*e^2 - B*a*c*e^2 - A*b*c*e^2)*ln(c*x^2 + b*x
 + a)/c^3 - (B*b*c^2*d^2 - 2*A*c^3*d^2 - 2*B*b^2*c*d*e + 4*B*a*c^2*d*e + 2*A*b*c
^2*d*e + B*b^3*e^2 - 3*B*a*b*c*e^2 - A*b^2*c*e^2 + 2*A*a*c^2*e^2)*arctan((2*c*x
+ b)/sqrt(-b^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*c^3)